package com.baomidou.springmvc.mapper.system;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.baomidou.springmvc.common.SuperMapper;
import com.baomidou.springmvc.model.dto.DrawPrizeRecordDTO;
import com.baomidou.springmvc.model.system.DrawPrizeRecord;

public interface DrawPrizeRecordMapper extends SuperMapper<DrawPrizeRecord>{

	@Select("SELECT dpr.*,p.desc,p.name from draw_prize_record  dpr LEFT JOIN prize p on dpr.type = p.type where open_id = #{openId}")
	DrawPrizeRecordDTO getRecord(@Param("openId") String openId);
	
	@Select("SELECT dpr.*,p.desc,p.name from draw_prize_record  dpr LEFT JOIN prize p on dpr.type = p.type order by dpr.createtime desc")
	List<DrawPrizeRecordDTO> getAllRecord();
}
